﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/ADAdminLayout.master" AutoEventWireup="true"
    CodeFile="lich_su_mua_hang.aspx.cs" Inherits="admin_Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="block" id="block-tables">
        <div class="content">
            <h2 class="title">
                Danh Sách Sản Phẩm Đã Chọn</h2>
            <div class="inner">
                <div class="group">
                    <label>
                        Từ khóa:</label>
                    <asp:TextBox ID="TextBox1" runat="server" class="text_field" size="60"></asp:TextBox>
                    &nbsp;
                    <label>
                        Tìm theo:
                    </label>
                    <select>
                        <option>Họ và tên</option>
                        <option>Số điện thoại</option>
                    </select>
                    &nbsp;
                    <button class="button slim-button" type="submit">
                        <img src="./images/search.png" alt="Tìm kiếm">
                        Tìm kiếm</button>
                </div>
                <br />
                <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSourceLichSuMuaHang"
                    AutoGenerateColumns="False" CssClass="table" PageSize="3">
                    <Columns>
                        <asp:TemplateField HeaderText="All" ItemStyle-HorizontalAlign="Left">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkAll" runat="server" onclick="SelectOrUnselectAll(this,'chkRow')" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkRow" runat="server" onclick="Check('chkRow')" />
                            </ItemTemplate>

<ItemStyle HorizontalAlign="Left"></ItemStyle>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="STT">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ho_ten" HeaderText="Họ và tên" SortExpression="ho_ten" />
                        <asp:BoundField DataField="so_dt" HeaderText="Số điện thoại" SortExpression="so_dt" />
                        <asp:BoundField DataField="dia_chi" HeaderText="Địa chỉ" SortExpression="dia_chi" />
                        <asp:BoundField DataField="ten_sp" HeaderText="Tên sản phẩm" SortExpression="ten_sp" />
                        <asp:BoundField DataField="mo_ta_sp" HeaderText="Mô tả sản phẩm" SortExpression="mo_ta_sp" />
                        <asp:BoundField DataField="gia_goc" HeaderText="Giá gốc" SortExpression="gia_goc" />
                        <asp:BoundField DataField="da_thanh_toan" HeaderText="Đã thanh toán" SortExpression="da_thanh_toan" />
                        <asp:HyperLinkField DataNavigateUrlFields="id" 
                            DataNavigateUrlFormatString="in_phieu.aspx?id={0}" Text="In phiếu" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSourceLichSuMuaHang" runat="server" ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>"
                    
                    SelectCommand="SELECT thanh_vien.ho_ten, thanh_vien.so_dt, thanh_vien.dia_chi, khuyen_mai.ten_sp, khuyen_mai.mo_ta_sp, mua_hang.id, mua_hang.gia_goc, mua_hang.da_thanh_toan FROM mua_hang INNER JOIN thanh_vien ON mua_hang.id_thanh_vien = thanh_vien.id INNER JOIN khuyen_mai ON mua_hang.id_khuyen_mai = khuyen_mai.id WHERE (thanh_vien.ho_ten LIKE '%' + @ho_ten + '%') OR (thanh_vien.so_dt LIKE '%' + @so_dt + '%')">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="TextBox1" DefaultValue="%%" Name="ho_ten" 
                            PropertyName="Text" />
                        <asp:ControlParameter ControlID="TextBox1" DefaultValue="%%" Name="so_dt" 
                            PropertyName="Text" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <div class="actions-bar wat-cf">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
